from Base.Base import Base
from selenium.webdriver.common.by import By
from time import sleep
class Page(Base):
    # 登录
    login_loc = (By.CLASS_NAME,'headerLogin')
    # 断言
    user_login = (By.CLASS_NAME,'userLogin.on')
    # 输入账号
    username_loc = (By.ID,'userName')
    # 输入密码
    password_loc=(By.ID,'password')
    # 点击登录
    login2_loc = (By.NAME,'bi_Usuallogin')
    # 点击确定
    bind_loc = (By.CLASS_NAME,'bindSub')
    def login(self):
        self.click(self.login_loc)
    def user_lg(self):
        return self.dy(self.user_login)
    def username(self):
        self.send_keys(self.username_loc,'15232008902')
    def password(self):
        self.send_keys(self.password_loc,'123456Aa')
    def login2(self):
        self.click(self.login2_loc)
    def bind(self):
        self.click(self.bind_loc)

    # 执行逻辑
    def login_lj(self):
        self.open_url('https://www.jiuxian.com/')
        self.login()
        a=self.user_lg()
        print(self.user_lg())
        assert a in '帐号登录'
        self.username()
        self.password()
        sleep(15)
        self.login2()
        self.bind()






